#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include<math.h>

int main() {
    int n;
    scanf("%d", &n);
    int x = 0;
    int i = 0;
    int max = 0;
    for (i = 0; i < n; i++)
    {
        scanf("%d", &x);
        max = (pow((int)sqrt(x), 2) != x) && max < x ? x : max;
    }
    printf("%d", max);
    return 0;
}